<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$课堂练习$</title>
</head>
<body>
<input type="button" value="设置p的内容" id="btn"/>
<p id="p1">我是一个p标签</p>
<script>
    document.getElementById("btn").onclick = function () {
        document.getElementById("p1").innerText = "这是一个p";

    };


</script>
</body>
</html>